package com.zdkj.subway.stm.sequence;/**
 * @author 陈博
 * @date 2020/5/28 0028 14:45
 */

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.zdkj.common.sequence.exception.SeqException;
import com.zdkj.common.sequence.sequence.impl.DefaultRangeSequence;

import java.util.Date;

/**
 * @program: zdkj
 *
 * @description: 序列号区间生成器接口调票实现
 *
 * @author: chen
 *
 * @create: 2020-05-28 14:45
 **/
public class CycleDefaultRangeSequence extends DefaultRangeSequence {

    /**
     * 将默认三位顺序号改为
     * @return
     * @throws SeqException
     */
    @Override
    public String nextNo() throws SeqException {
        return String.format("%s%03d", DateUtil.format(new Date(), DatePattern.PURE_DATE_FORMAT), nextValue());
    }
}
